﻿namespace HRM.CORE
{
    using DevExpress.XtraEditors;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;

    public class xfmSalaryPay : XtraForm
    {
        private IContainer components = null;
        private HRM.CORE.xucSalaryPay xucSalaryPay;

        public event SalaryPayChangedHander SalaryPayChanged;

        public xfmSalaryPay()
        {
            this.InitializeComponent();
            base.Load += new EventHandler(this.xfmSalary_Load);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x350, 0x22b);
            base.Name = "xfmSalaryPay";
            this.Text = "Bảng Thanh To\x00e1n Lương";
            base.ResumeLayout(false);
        }

        private void RaiseSalaryPayChangedHander()
        {
            if (this.SalaryPayChanged != null)
            {
                this.SalaryPayChanged(this);
            }
        }

        public void SetMonthYear(int Month, int Year)
        {
            if (this.xucSalaryPay != null)
            {
                this.xucSalaryPay.SetMonthYear(Month, Year);
            }
        }

        private void xfmSalary_Load(object sender, EventArgs e)
        {
            this.xucSalaryPay = new HRM.CORE.xucSalaryPay();
            this.xucSalaryPay.Closed += new HRM.CORE.xucSalaryPay.ClosedHander(this.xucSalaryPay_Closed);
            this.xucSalaryPay.SalaryPayChanged += new HRM.CORE.xucSalaryPay.SalaryPayChangedHander(this.xucSalaryPay_SalaryPayChanged);
            this.xucSalaryPay.Dock = DockStyle.Fill;
            base.Controls.Add(this.xucSalaryPay);
        }

        private void xucSalaryPay_Closed(object sender)
        {
            base.Close();
        }

        private void xucSalaryPay_SalaryPayChanged(object sender)
        {
            this.RaiseSalaryPayChangedHander();
        }

        public delegate void SalaryPayChangedHander(object sender);
    }
}

